﻿Public Class FrmImport

    Public Upload As Object
    Dim Break As Boolean

    Private Sub FrmImport_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
        ProgressBar1.Maximum = Upload.Count
        Picture.BackgroundImageLayout = ImageLayout.Stretch
        Application.DoEvents()
        For Each File As String In Upload
            Label.Text = File
            If File.ToLower.EndsWith(".jpg") Then
				'Studio.AddPhoto(Studio.Current, File)
                Picture.BackgroundImage = Image.FromFile(MainFolder & "sd\" & My.Computer.FileSystem.GetName(File))
            Else
				'Studio.AddVideo(Studio.Current, File)
                Picture.BackgroundImage = My.Resources.video
            End If
            ProgressBar1.Increment(1)
            Application.DoEvents()
            If Break Then Exit For
        Next
		DialogResult = Windows.Forms.DialogResult.OK
        Close()
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Not Confirm("Yükleme işlemini yarıda kesmek istediğinizden emin misiniz?") Then Exit Sub
        Break = True
    End Sub

End Class